package avicit.bdp.dgs.qa.dto;

import avicit.bdp.common.base.BaseDTO;

import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2023-05-29
 * @类说明：WorkOrderHistoryDTO
 * @修改记录：
 * @注意事项：
 * @主要功能：工单历史记录DTO
 */
@ApiModel(value = "WorkOrderHistoryDTO", description = "工单历史记录DTO")
@Table(name = "bdp_dgs_qa_work_order_history")
public class WorkOrderHistoryDTO extends BaseDTO {
    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 内容
     */
    @LogField
    @ApiModelProperty(value = "内容")
    @FieldRemark(column = "content", field = "content", name = "内容")
    @Column(name = "content")
    private String content;

    /**
     * 状态，0:待指派、1:待处理、2:待验证、3:已完结
     */
    @LogField
    @ApiModelProperty(value = "状态，0:待指派、1:待处理、2:待验证、3:已完结")
    @FieldRemark(column = "state", field = "state", name = "state")
    @Column(name = "state")
    private Integer state;
    @Transient
    private String stateName;

    /**
     * 工单ID
     */
    @LogField
    @ApiModelProperty(value = "工单ID")
    @FieldRemark(column = "workOrder", field = "workOrder", name = "工单ID")
    @Column(name = "work_order_id")
    private String workOrderId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getStateName() {
        return stateName;
    }

    public void setStateName(String stateName) {
        this.stateName = stateName;
    }

    public String getWorkOrderId() {
        return workOrderId;
    }

    public void setWorkOrderId(String workOrderId) {
        this.workOrderId = workOrderId;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "工单管理模块";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "历史工单";
        } else {
            return super.logTitle;
        }
    }
}
